import router from "./index"

router.beforeEach((to,from,next)=>{
    if(to.meta.isLogin){
        let token = false;
        if(token){
            next();
        }else{
            next({
                name:"login"
            })
        }
    }else{
        next();
    }
})
router.beforeEach((to,from,next)=>{
    var token=localStorage.getItem("token");
    if(to.meta.requireAuth){
      if(token){
        next();
      }
      else{
        next({name:"login"});
      }
    }
    else{
      next();
    }
  });